package com.ccbhelper.provider;

import java.sql.Date;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;

	public class BankAmount implements Parcelable{

		private String name;
		private String type;
		private double time_amount;
		private double add_amount;
		private double yearadd_amount;
		private String curr_type;
		private String unit;
		private String time;
		
		public BankAmount(String name,String type,String time_amount,String add_amount,String yearadd_amount,String curr_type,String unit,String time){
		
			this.name =name;
			this.type = type;
			if(time_amount !=null)
			{				
		    	this.time_amount = Double.valueOf(time_amount);
			}
			else
				this.time_amount = 0;
			if(add_amount !=null)
			{				
		    	this.add_amount = Double.valueOf(add_amount);
			}
			else
				this.add_amount = 0;	
			if(yearadd_amount !=null)
			{				
		    	this.yearadd_amount = Double.valueOf(yearadd_amount);
			}
			else
				this.yearadd_amount = 0;				
		    this.curr_type = curr_type;
		    this.unit = unit;
		    this.time = time;
		
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		public double getTime_amount() {
			return time_amount;
		}
		public void setTime_amount(double time_amount) {
			this.time_amount = time_amount;
		}
		public double getAdd_amount() {
			return add_amount;
		}
		public void setAdd_amount(double add_amount) {
			this.add_amount = add_amount;
		}
		public double getYearadd_amount() {
			return yearadd_amount;
		}
		public void setYearadd_amount(double yearadd_amount) {
			this.yearadd_amount = yearadd_amount;
		}
		public String getTime() {
			return time;
		}
		public void setTime(String time) {
			this.time = time;
		}
		public String getCurr_type() {
			return curr_type;
		}
		public void setCurr_type(String curr_type) {
			this.curr_type = curr_type;
		}
		public String getUnit() {
			return unit;
		}
		public void setUnit(String unit) {
			this.unit = unit;
		}
		public BankAmount(){};
		public static final Parcelable.Creator<BankAmount> CREATOR = new Creator<BankAmount>(){  
			  
	        public BankAmount createFromParcel(Parcel source) {  
	            // TODO Auto-generated method stub  
	        	BankAmount amount = new BankAmount();  
	        	amount.setName(source.readString());
	        	amount.setType(source.readString());
	        	amount.setAdd_amount(source.readDouble());
	        	amount.setTime_amount(source.readDouble());
	        	amount.setYearadd_amount(source.readDouble());
	        	amount.setTime(source.readString());
	        	amount.setCurr_type(source.readString());
	        	amount.setUnit(source.readString());
	            return amount;  
	        }  
	  
	        public BankAmount[] newArray(int size) {  
	            // TODO Auto-generated method stub  
	            return new BankAmount[size];  
	        }  
	          
	    };  
	    
		@Override
		public int describeContents() {
			// TODO Auto-generated method stub
			return 0;
		}
		@Override
		public void writeToParcel(Parcel dest, int flags) {
			// TODO Auto-generated method stub
			dest.writeString(name);
			dest.writeString(type);
			dest.writeDouble(time_amount);
			dest.writeDouble(add_amount);
			dest.writeDouble(yearadd_amount);
			dest.writeString(curr_type);
			dest.writeString(unit);
			dest.writeString(time);

		}
		
}
